package com.junjun.ssm.service.serviceImpl;

import com.junjun.ssm.dao.MoveDao;
import com.junjun.ssm.entity.MovieEntity;
import com.junjun.ssm.service.IMovieService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MovieServiceImpl implements IMovieService {

    @Autowired
    MoveDao moveDao;


    @Override
    public MovieEntity queryMovieByName(String movieName) {
        return moveDao.findAllByName(movieName);
    }

    @Override
    public void addMovie(MovieEntity movieEntity) {
        moveDao.save(movieEntity);
    }

    @Override
    public List<MovieEntity> queryAllMovie() {
        return moveDao.findAllMovie();
    }
}
